<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>个人中心</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f4f4f4;
            margin: 0;
            padding: 0;
        }
        .container {
            width: 80%;
            margin: 50px auto;
            background: white;
            padding: 20px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
            border-radius: 8px;
        }
        h1 {
            color: #333;
            text-align: center;
        }
        .info {
            margin-bottom: 20px;
            text-align: center; /* 使内容居中 */
        }
        .info p {
            font-size: 16px;
            color: #555;
        }
        .actions {
            display: flex; /* 使用 Flexbox 布局 */
            flex-direction: column; /* 垂直排列 */
            align-items: center; /* 水平居中 */
        }
        .actions a {
            display: inline-block;
            margin: 10px 0;
            padding: 10px 20px;
            background-color: #007bff;
            color: white;
            text-decoration: none;
            border-radius: 5px;
            transition: background-color 0.3s;
        }
        .actions a:hover {
            background-color: #0056b3;
        }
        .message {
            color: red;
            text-align: center;
        }
    </style>
</head>
<body>
<div class="container">
    <h1>个人中心</h1>
    <c:if test="${not empty user}">
        <div class="info">
            <p>姓名: ${user.username}</p>
            <p>手机号码: ${user.phoneNumber}</p>
        </div>
        <div class="actions">
            <a href="${pageContext.request.contextPath}/user/updatePhone">修改手机号</a>
            <a href="${pageContext.request.contextPath}/user/updatePassword">修改密码</a>
        </div>
    </c:if>
    <c:if test="${empty user}">
        <p class="message">请先登录</p>
    </c:if>
</div>
</body>
</html>
